package com.example.canyun;

import com.service.impl.Webserviceimpl;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.xml.ws.Endpoint;

import com.service.impl.WeatherService;

@SpringBootApplication
public class CanyunApplication {

	/*
	public static void main(String[] args) {
		SpringApplication.run(CanyunApplication.class, args);
		String  url="http://192.168.4.35:17855/cuanyunweb?wsdl";
        Endpoint.publish(url,new Webserviceimpl());
        System.out.print("发布webservice成功");
	}
	*/

	public static void main(String[] args) {
		String url="http://10.24.102.11:17855/ws_server/weather";

		WeatherService weather =	new WeatherService();
		//第一种发布：最简单直接的webService发布,默认使用的是soap1.1
		Endpoint.publish(url, weather);

		//第二种发布：使用的是soap1.2,可能会出现报错--Cannot generate WSDL for binding ，原因jar包版本低
		//Endpoint.create("http://www.w3.org/2003/05/soap/bindings/HTTP/",weather).publish(url);

		//第三种发布：使用的是xsoap1.2,可以处理客户端soap1.2,会出现警告--为指定的绑定生成非标准 WSDL
		//Endpoint.create("http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/",weather).publish(url);


		//Endpoint.create("http://www.w3.org/2003/05/soap/bindings/HTTP/",weather).publish(url);
		System.out.println("publish success...");
		System.out.print("发布webservice成功");
	}

}
